import { http } from '../http';
import type {
	GetTextBoardParamsType,
	GetTextBoardResponseType,
	GetAiChapterAllParamsType,
	GetAiChapterAllResponseType,
	GetPPTListResponseType,
	GetSliceByLessonCodeParamsType,
	GetSliceByLessonCodeResponseType,
	GetLLMTeacherLeadQusParamsType,
	GetLLMTeacherLeadQusResponseType,
	GetSliceTypeListResponseType,
	GetAnalysisResultResponseType,
	GetEventTimeLineResponseType,
	GetAudioTaskTimeTableParamsType,
	GetAudioTaskTimeTableResponseType,
	GetLessonTeacherPathParamsType,
	GetLessonTeacherPathResponseType,
	GetLessonTeacherBehaviorParamsType,
	GetLessonTeacherBehaviorResponseType,
	GetAudioVolTaskResultResponseType,
	GetAudioTaskSpeakSpeedTimeTableParamsType,
	GetAudioTaskSpeakSpeedTimeTableResponseType,
	GetSpecialWordResultParamsType,
	GetSpecialWordResultResponseType,
	GetKeyWordResultParamsType,
	GetKeyWordResultResponseType,
	GetAILessonAttendResponseType,
	GetAILessonBehaviorDetailResponseType,
	GetAILessonBehaviorStatResponseType,
	GetInteractiveResultResponseType,
	GetSummaryContentParamsType,
	GetLLMScoreResultParamsType,
	GetLLMScoreResultResponseType
} from './lesson-analysis-details.type';

const aiasUrl = '/api/aias';

/**
 * @description 获取课堂的文字看板内容
 * @param {string} params.businessCode 业务编号
 * @param {int} params.businessType 业务的类型
 * @param {string} params.searchValue 文字看板内容
 * @param {int} params.lessonId 业务编号
 * @param {int} params.isFilter 是否过滤 1-过滤 0-不过滤
 * @param {int} params.sensitiveFilter 是否敏感词过滤 1 不过滤 2 过滤
 */
export const getTextBoardAPI = (
	params: GetTextBoardParamsType
): Promise<GetTextBoardResponseType> => {
	return http.post(`${aiasUrl}/lesson/getTextBoard`, params);
};

/**
 * @description 获取AI章节
 * @param {string} params.businessCode 业务编号
 */
export const getAiChapterAllAPI = (
	params: GetAiChapterAllParamsType
): Promise<GetAiChapterAllResponseType> => {
	return http.get(`${aiasUrl}/lesson/getAiChapterAll`, {
		params
	});
};

/**
 * @description 查询PPT
 * @param {string} lessonCode 课堂编号
 */
export const getPPTListAPI = (lessonCode: string): Promise<GetPPTListResponseType> => {
	return http.get(`${aiasUrl}/lesson/getPPTList`, {
		params: { lessonCode }
	});
};

/**
 * @description 查询内容量标/教学环节片段
 * @param {string} params.lessonCode 课堂编号
 * @param {string} params.sliceType 切片分组类型：知识点 -knowledge  教学环节-outline  教学内容-teaching  课程思政-politic  理论联系实际-teaching-theoryActual  前沿性-teaching-frontier  趣味性-teaching-enjoyment  高阶性-teaching-highOrder
 * @param {string[]} params.indicatorCodes 课堂指标编码编号
 * @param {string} params.businessType 业务类型，默认为1表示课堂实录
 */
export const getSliceByLessonCodeAPI = (
	params: GetSliceByLessonCodeParamsType
): Promise<GetSliceByLessonCodeResponseType> => {
	return http.post(`${aiasUrl}/lesson/getSliceByLessonCode`, params);
};

/**
 * @description 查询教师引导提问
 * @param {string} params.businessCode 业务编号
 * @param {string} params.businessType 业务类型，默认为1表示课堂实录
 */
export const getLLMTeacherLeadQusAPI = (
	params: GetLLMTeacherLeadQusParamsType
): Promise<GetLLMTeacherLeadQusResponseType> => {
	return http.post(`${aiasUrl}/lesson/getLLMTeacherLeadQus`, params);
};

/**
 * @description 获取指标分组列表
 */
export const getSliceTypeListAPI = (): Promise<GetSliceTypeListResponseType> => {
	return http.get(`${aiasUrl}/lesson/getSliceTypeList`);
};

/**
 * @description 查询指定课堂AI分析结果
 * @param {string} lessonCode 课堂编号
 */
export const getAnalysisResultAPI = (
	lessonCode: string
): Promise<GetAnalysisResultResponseType> => {
	return http.get(`${aiasUrl}/lesson/getAnalysisResult`, {
		params: { lessonCode }
	});
};

/**
 * @description 查询指定课堂关键事件分布信息
 * @param {string} lessonCode 课堂编号
 */
export const getEventTimeLineAPI = (lessonCode: string): Promise<GetEventTimeLineResponseType> => {
	return http.get(`${aiasUrl}/lesson/getEventTimeLine`, {
		params: { lessonCode }
	});
};

/**
 * @description 根据语音转写结果获取课堂讲课时间轴
 * @param {string} params.businessCode 课堂编号
 * @param {int} params.timeInterval 时间间隔(ms)
 */
export const getAudioTaskTimeTableAPI = (
	params: GetAudioTaskTimeTableParamsType
): Promise<GetAudioTaskTimeTableResponseType> => {
	return http.get(`${aiasUrl}/lesson/getAudioTaskTimeTable`, { params });
};

/**
 * @description 获取一节课老师轨迹统计信息
 * @param {string} params.lessonCode 课堂编号
 */
export const getLessonTeacherPathAPI = (
	params: GetLessonTeacherPathParamsType
): Promise<GetLessonTeacherPathResponseType> => {
	return http.post(`${aiasUrl}/lesson/getLessonTeacherPath`, params);
};

/**
 * @description 获取一节课老师行为统计信息
 * @param {string} params.lessonCode 课堂编号
 */
export const getLessonTeacherBehaviorAPI = (
	params: GetLessonTeacherBehaviorParamsType
): Promise<GetLessonTeacherBehaviorResponseType> => {
	return http.post(`${aiasUrl}/lesson/getLessonTeacherBehavior`, params);
};

/**
 * @description 查询指定课堂音量分析结果
 * @param {string} businessCode 课堂编号
 */
export const getAudioVolTaskResultAPI = (
	businessCode: string
): Promise<GetAudioVolTaskResultResponseType> => {
	return http.get(`${aiasUrl}/lesson/getAudioVolTaskResult`, {
		params: { businessCode }
	});
};

/**
 * @description 根据语音转写结果获取老师语速时间轴
 * @param {string} params.businessCode 课堂编号
 * @param {int} params.timeInterval 时间间隔(s)
 */
export const getAudioTaskSpeakSpeedTimeTableAPI = (
	params: GetAudioTaskSpeakSpeedTimeTableParamsType
): Promise<GetAudioTaskSpeakSpeedTimeTableResponseType> => {
	return http.get(`${aiasUrl}/lesson/getAudioTaskSpeakSpeedTimeTable`, { params });
};

/**
 * @description 查询指定课堂习惯用语、敏感词识别结果
 * @param {string} params.lessonCode 课堂编号
 * @param {int} params.lexiconType 关键词类型：1000-习惯用语 1001-敏感词
 */
export const getSpecialWordResultAPI = (
	params: GetSpecialWordResultParamsType
): Promise<GetSpecialWordResultResponseType> => {
	return http.get(`${aiasUrl}/lesson/getSpecialWordResult`, { params });
};

/**
 * @description 查询AI课堂知识点
 * @param {string} params.businessCode 课堂编号
 */
export const getKeyWordResultAPI = (
	params: GetKeyWordResultParamsType
): Promise<GetKeyWordResultResponseType> => {
	return http.get(`${aiasUrl}/lesson/getKeyWordResult`, {
		params
	});
};

/**
 * @description 查询指定课堂出勤情况
 * @param {string} lessonCode 课堂编号
 */
export const getAILessonAttendAPI = (
	lessonCode: string
): Promise<GetAILessonAttendResponseType> => {
	return http.get(`${aiasUrl}/lesson/getAILessonAttend`, {
		params: { lessonCode }
	});
};

/**
 * @description 查询指定课堂行为详细数据
 * @param {string} lessonCode 课堂编号
 */
export const getAILessonBehaviorDetailAPI = (
	lessonCode: string
): Promise<GetAILessonBehaviorDetailResponseType> => {
	return http.get(`${aiasUrl}/lesson/getAILessonBehaviorDetail`, {
		params: { lessonCode }
	});
};

/**
 * @description 查询指定课堂行为统计数据
 * @param {string} lessonCode 课堂编号
 */
export const getAILessonBehaviorStatAPI = (
	lessonCode: string
): Promise<GetAILessonBehaviorStatResponseType> => {
	return http.get(`${aiasUrl}/lesson/getAILessonBehaviorStat`, {
		params: { lessonCode }
	});
};

/**
 * @description 查询指定课堂互动统计情况
 * @param {string} lessonCode 课堂编号
 */
export const getInteractiveResultAPI = (
	lessonCode: string
): Promise<GetInteractiveResultResponseType> => {
	return http.get(`${aiasUrl}/lesson/getInteractiveResult`, {
		params: { lessonCode }
	});
};

/**
 * @description 查询指定课堂AI教学内容总结结果
 * @param {string} params.lessonCode 课堂编号
 */
export const getSummaryContentAPI = (params: GetSummaryContentParamsType): Promise<string> => {
	return http.get(`${aiasUrl}/lesson/getSummaryContent`, { params });
};

/**
 * @description 查询大语言模型内容分析结果
 * @param {string} params.businessCode 课堂编号
 * @param {int} params.type 数据类型 1-鼓励学生提问 2-教学内容准确性 3-语言表达能力（默认） 4-引导学生 5-优点 6-缺点
 */
export const getLLMScoreResultAPI = (
	params: GetLLMScoreResultParamsType
): Promise<GetLLMScoreResultResponseType> => {
	return http.get(`${aiasUrl}/lesson/getLLMScoreResult`, {
		params
	});
};
